@{ViewBag.Title = " Media "; Layout = "../Shared/_LayoutJtable.cshtml";}

<div class="filtering"><form>
<label>Introduzca texto para filtrar: <input type="text" name="filter" id="filter" /></label>
<button type="submit" id="LoadRecordsButton" class="button medium orange" >Buscar Coincidencias</button>
</form></div>
<div id="MyTableContainer"></div>
<script type="text/javascript">
     $(document).ready(function () {
     $('#MyTableContainer').jtable({
         title: 'Media',
         paging: true,
         pageSize: 40,
         sorting: true,
         defaultSorting: 'Id ASC',
         actions: {
             listAction: '@Url.Action("JSONPagedListByFilterLite")',
             deleteAction: '@Url.Action("JSONDelete")'            
         },
         fields:
         {
          Id: {
                 key: true,
                 list: false
          },
             FechaCreacion: {
             title:'FechaCreacion',
             list: true,
             type: 'date',
             displayFormat: 'dd/mm/yy',             
             sorting: false
             }
             ,
             GuidSolicitante: {
                 title: 'Guid Solicitante',
                 list: true,
                 sorting: false
             }
             ,
             TituloRecurso: {
             title: 'Titulo Recurso',
             list: true,
             sorting: false
             }             
             
},
formCreated: function (event, data) {data.form.validationEngine();},
formSubmitting: function (event, data) {return data.form.validationEngine('validate');},
formClosed: function (event, data) { data.form.validationEngine('hide'); data.form.validationEngine('detach'); }
});
$('#LoadRecordsButton').click(function (e) {e.preventDefault();$('#MyTableContainer').jtable('load', {filter: $('#filter').val()});});
$('#LoadRecordsButton').click();
});
</script>

